package com.legolas.utils;

import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;

public class WebUtil {

    public static boolean isAjax(ServletRequest request) {
        String header = ((HttpServletRequest) request).getHeader("X-Requested-With");
        if (header != null && "XMLHttpRequest".equalsIgnoreCase(header)) {
            return Boolean.TRUE;
        }
        return Boolean.FALSE;
    }

}
